package com.xiangxiangjd.aircraftanalysis.config.dictutils;

import freemarker.template.Configuration;
import freemarker.template.TemplateModelException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author LF
 * @date 2020/9/2 - 11:30
 */
@Component
public class FreemarkerConfig {
    @Autowired
    private Configuration configuration;
    @Autowired
    private DictDirective dictDirective;


    @PostConstruct
    public void setSharedVariable() throws TemplateModelException {
        configuration.setSharedVariable("dict_tag", dictDirective);

    }
}
